﻿// See https://aka.ms/new-console-template for more information


//获取枚举的特性(用反射的方式)
using Max.PH5_2011A.Domain.Shared;

var t = typeof(OrderState);
var fs = t.GetFields();

fs.ToList().ForEach(f =>
{
    //global::System.Console.WriteLine(f.Name);

    var os = f.GetCustomAttributes(typeof(System.ComponentModel.DataAnnotations.DisplayAttribute), true);
    if (os != null && os.Length>0)
    {
        var dname = ((System.ComponentModel.DataAnnotations.DisplayAttribute)(os[0])).Name;
        global::System.Console.WriteLine(dname);
    }
});



Console.ReadKey();
